package com.jiyi.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class UserDB extends SQLiteOpenHelper{
	private final static int VERSION = 2;
	
	public static final String USERACCOUNT = "useraccount";
	
	public static final String PASSWORD = "password";	
	
	public static final String USERTB = "usertb";
	
	
	@Override
	public void onCreate(SQLiteDatabase db) {
		
		//创建表
		db.execSQL("create table usertb(_id integer primary key autoincrement not null,useraccount text,password text)");
	}
	
	//创建数据库
	public UserDB(Context context) {
		super(context, "user.db", null, VERSION);
		
	}
	//版本更新
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {		
		
		db.execSQL("drop table usertb");
		onCreate(db);
	}

}
